<template>
  <el-card shadow="never" class="aui-cchangeAdvanceard--fill">
    <div class="mod-wms__supplier}">
      <wms-form v-model="dataForm" :formList="formList" :table-column="tableColumn" :advanced="advanced"
        @check-change="checkChange" @changeAdvance="changeAdvance" @getDataList="getDataList" @getReset="getReset">
        <el-form-item>
          <el-button v-if="$hasPermission('wms:supplier:save')" type="primary" @click="addOrUpdateHandle()">{{
            $t('add')
          }}</el-button>
        </el-form-item>
      </wms-form>
      <wms-table ref="wmsTable" v-model="dataForm" :page="page" :total="total" :limit="limit" :tableData="dataList"
        :table-column="column" :module-options="mixinViewModuleOptions" :dataListLoading="dataListLoading"
        :showSelection="true" @addOrUpdateHandle="addOrUpdateHandle"
        @dataListSelectionChangeHandle="dataListSelectionChangeHandle" @deleteHandle="deleteHandle"
        @pageSizeChangeHandle="pageSizeChangeHandle" @pageCurrentChangeHandle="pageCurrentChangeHandle" />
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    </div>
  </el-card>
</template>

<script>
import mixinViewModule from "@/mixins/view-module";
import AddOrUpdate from "./components/supplier-add-or-update";
import debounce from "lodash/debounce";
import { formList, tableColumn } from './config'
import wmsTable from '@/components/wms-table'
import wmsForm from '@/components/wms-form'
export default {
  mixins: [mixinViewModule],
  data() {
    return {
      mixinViewModuleOptions: {
        getDataListURL: "/wms/supplier/page",
        getDataListIsPage: true,
        exportURL: "/wms/supplier/export",
        deleteURL: "/wms/supplier",
        deleteIsBatch:true
      },
      dataForm: {
        id:'',
        supplierCode: '',
        supplierName: ''
      },
      formList,
      tableColumn,
      column: [],
      advanced: false
    };
  },
  components: {
    AddOrUpdate,
    wmsTable,
    wmsForm
  },
  methods: {
    //0.重置搜索框
    getReset() {
      this.dataForm = this.$options.data().dataForm;
    }
  },
};
</script>
<style>
.right-handle-group {
  float: right;
}
</style>
